home *** CD-ROM | disk | FTP | other *** search
/ Commodore Free 22 / Commodore_Free_Issue_22_2008_Commodore_Computer_Club.d64 / t.uiec 2 < prev    next >
Text File  |  2023-02-26  |  12KB  |  408 lines

  1. u
  2.  
  3. UIEC INFORMATION
  4.  
  5.          CONTINUED FROM PART 1
  6.  
  7. - M-R, M-W, M-E  Memory Reading returns
  8. random data of the requested length.
  9. Memory Writing knows about the address
  10. used for changing the device address on
  11. a 1541 and will change the address of
  12. sd2iec to the requested value. It will
  13. also check if the transmitted data
  14. corresponds to any of the known
  15. software fastloaders so the correct
  16. emulation code can be used when M-E is called.
  17.  
  18. - E-R, E-W  Both commands work like M-R
  19. and M-W, but instead of reading/writing
  20. RAM they allow access to a user-area of
  21. the EEPROM. This area currently holds
  22. 512 bytes and any access beyond this
  23. area will result in a 32 SYNTAX ERROR.
  24. It is strongly recommended to work
  25. on a protocol for sharing this area
  26. between multiple applications that
  27. want to store their configuration in
  28. there, but that is beyond the scope
  29. of this project.
  30.  
  31. As the contents of the EEPROM have
  32. to be copied to RAM before they can
  33. be sent to the computer, it is not
  34. possible to read more data with a
  35. single command than the error
  36. message buffer (default size: 36
  37. bytes) can hold. Similarly, writing is
  38. restricted by the size of the command
  39. buffer (at least 42 bytes for
  40. compatibility, expected to be at least
  41. 100 bytes in release versions).
  42.  
  43. The user-area does not interfere with
  44. the stored configuration (XW) in any
  45. way.
  46.  
  47. Long File Names:
  48. ================
  49. Long file names (i.e. names not within
  50. the 8.3 limits) are supported on FAT,
  51. but for compatibility reasons the 8.3
  52. name is used if the long name exceeds
  53. 16 characters. If you use anything but
  54. ASCII characters on the PC or their
  55. PETSCII equivalents on the Commodore,
  56. you may get strange characters on the
  57. other system because the LFN use
  58. unicode characters on disk, but sd2iec
  59. parses only the low byte of each
  60. character in the name.
  61.  
  62. Partition:
  63. ==========
  64. sd2iec features a multi-partition
  65. support similar to that of the CMD
  66. drives. The partitions (which may be
  67. on separate drives for some hardware
  68. configurations) are accessed using the
  69. drive number of the commands sent from
  70. the computer and are numbered starting
  71. with 1. Partition 0 is a special case:
  72. Because most software doesn't support
  73. drive numbers, or always sends drive
  74. number 0, this partition points to the
  75. currently selected partition. By
  76. default, accesses to partition 0 will
  77. access partition 1, this can be
  78. changed by sending "CP<num>" over the
  79. command channel with <num> being an
  80. ASCII number from 1 to 255.
  81.  
  82. "C<Shift-P"
  83. (0x42 0xd0) works the same, but
  84. expects a binary partition number as
  85. the third character of the command.
  86.  
  87. Software fastloaders:
  88. =====================
  89. Turbodisk
  90. ---------
  91. Turbodisk is detected by the CRC of
  92. its 493 byte long floppy code and
  93. the M-E address 0x0303. The same
  94. code seems to be used under various
  95. names, among them "Turbodisk" (both 2.1
  96. and 2.2) and "Fast-Load". Unfortunately
  97. the timing requirements are extremely
  98. tight and cannot be met with the
  99. internal RC oscillator of the AVR
  100. even if calibrated. You really need an
  101. external 8MHz crystal or the data
  102. read by the C64 will be gibberish.
  103. It is not known if there is an NTSC-
  104. compatible version of this fastloader.
  105.  
  106. Final Cartridge III
  107. -------------------
  108. Both the fast loader and the fast
  109. saver of Final Cartridge III are
  110. supported.
  111. The fast loader seems to work
  112. without a crystal, the fast saver was
  113. not tested. It is not known if there is
  114. an NTSC-compatible version using the
  115. same drive code, but at least for
  116. the fastloader the FC3 rom seems to
  117. contain two different C64-side
  118. implementations.
  119.  
  120. Action Replay 6
  121. ---------------
  122. The AR6 reads a byte from the drive
  123. rom to check which fastloader it
  124. should use. sd2iec returns a value that
  125. should force the cartridge to use
  126. the standard kernal loader instead
  127. of its (still unsupported) fastloader.
  128.  
  129. Dreamload
  130. ---------
  131. Dreamload uses direct track/sector
  132. access, so it is only supported on D41
  133. or similar disk image formats. As
  134. sd2iec has to wait for commands from
  135. the C64 constantly the disk change
  136. buttons may become unresponsive,
  137. try multiple times if you need to.
  138. Dreamload is a "captive" fastloader,
  139. sd2iec stays in Dreamload mode until
  140. it receives a "quit loader" command
  141. from the C64. To force sd2iec to
  142. resume normal operation, hold the disk
  143. change button until the red LED
  144. turns on (just like sleep mode).
  145.  
  146. Please note that Dreamload does not
  147. work with more than one device on the
  148. serial bus due to the way it uses
  149. the ATN line.
  150.  
  151. JiffyDOS:
  152. =========
  153. The JiffyDOS protocol has very relaxed
  154. timing constraints compared to
  155. Turbodisk, but still not as relaxed as
  156. the standard Commodore IEC protocol.
  157. Jiffy seems to tolerate slightly
  158. mis-tuned RC oscillators, but you
  159. still shouldn't expect it to work
  160. without oscillator calibration. If the
  161. frequency error is too big you WILL
  162. get wrong data which usually manifests
  163. as a FILE NOT FOUND error, because the
  164. name the drive received was already
  165. garbled.
  166.  
  167. x00 files:
  168. ==========
  169. P00/S00/U00/R00 files are
  170. transparently supported, that means
  171. they show up in the directory listing
  172. with their internal file name; instead
  173. of the FAT file name. Renaming them
  174. only changes the internal name. The XE
  175. command defines if x00 extensions are
  176. used when writing files, by default
  177. sd2iec uses them for SEQ/USR/REL files
  178. but not for PRG. Parsing of x00 files
  179. is always enabled even when writing
  180. them is not.
  181.  
  182. x00 files are recognized by checking
  183. both the extension of the file
  184. (P/S/U/R with a two-digit suffix) and
  185. the header signature.
  186.  
  187. Disk Images:
  188. ============
  189. Disk images are recognized by their
  190. file extension (.D64, .D41) and their
  191. file size (must be one of 174848,
  192. 175531). If the image has an error
  193. info block appended, it will be used
  194. to simulate read errors. Writing to a
  195. sector with an error will always work,
  196. but it will not clear the indicated
  197. error.
  198.  
  199. M2I files:
  200. ==========
  201. M2I files are fully supported. sd2iec
  202. supports SEQ and USR files in this
  203. format in addition to PRG and DEL
  204. which were already implemented in
  205. MMC2IEC. For compatibility reasons the
  206. file type is not checked when opening
  207. files. Inside an M2I file the files
  208. are always shown as 0 (DEL) or 1
  209. blocks; because calling stat for every
  210. file was slowing down the directory
  211. listing too much. For compatibility
  212. with existing M2I files the data files
  213. do not use P00 headers even when the
  214. file type is SEQ or USR.
  215.  
  216. Changing Disk Images
  217. ====================
  218. Because some programs require more
  219. than one disk side there is support
  220. for changing the currently mounted
  221. disk image with a button connected to
  222. the disk change pin.
  223.  
  224. If your circuit doesn't have a disk
  225. change pin/button you might be able to
  226. add it yourself:
  227. - For the original MMC2IEC and the NKC
  228. MMC2IEC:
  229. Connect a button from PA4 to ground.
  230. PA4 is pin 36 on the DIL version
  231. of the controller or pin 33 on the
  232. surface-mount version.
  233. - For Shadowolf's MMC2IEC 1.x PCBs:
  234. Connect a button from PC4 to ground.
  235. PC4 is pin 23 on the DIL version
  236. of the controller or pin 23 on the
  237. surface-mount version.
  238. - Any other circuit without disk
  239. change pin on a convenient connector
  240. somewhere and no button dedicated to
  241. that function: Please check
  242. with the supplier of the board, and
  243. read config.h in the sources
  244. to find out how to connect it.
  245.  
  246. To use this functionality, create a
  247. text file that lists the file names of
  248. all disk images you want to swap
  249. between, one per line. The file names
  250. are parsed in the same way as the CD
  251. command, so you can include a path to
  252. the image if desired.
  253.  
  254. Examples:
  255. === example 1 ===
  256. FOO.D64
  257. BAR.D64
  258. BAZ.D64
  259. === end of example 1 ===
  260.  
  261. === example 2 ===
  262. //NEATGAME/:DISK1A.D64
  263. //NEATGAME/:DISK1B.D64
  264. //NEATGAME/:DISK2A.D64
  265. //NEATGAME/:DISK2B.D64
  266. === end of example 2 ===
  267.  
  268. The swap list is enabled by sending
  269. "XS:filename" over the command channel
  270. with filename being the name of the
  271. image list you created, parsed in the
  272. same way as any other file name.
  273.  
  274. After sending XS the first image in
  275. the list is automatically mounted. To
  276. switch to the next image in the list,
  277. push the button. If the new image was
  278. mounted successfully both LEDs will
  279. blink twice. When you've reached the
  280. last image in the list pushing the
  281. button will mount the first image
  282. again. All of this is completely
  283. compatible with normal image
  284. mounting/unmounting, so you can
  285. unmount the disk image any time you
  286. want, and resume the mount cycle later
  287. by pushing the button.
  288.  
  289. Due to the way this feature is
  290. implemented you are not limited to a
  291. swap list containing just D64 images,
  292. M2I and even FAT directories will work
  293. too.FIXME: Does that still work?
  294.  
  295. If you press the button when no list
  296. has been set before, or when the
  297. previous list was cleared by sending
  298. XS the software will look for a file
  299. called AUTOSWAP.LST in the current
  300. (FAT-) directory and use this as the
  301. current swap list until you deactivate
  302. it or manually change the directory
  303. (otherwise an AUTOSWAP.LST in the new
  304. directory would be ignored until you
  305. send XS, killing the nice "it just
  306. works" feeling).
  307.  
  308. FIXME: Integrate the following into
  309. the preceding
  310.  
  311. The second disk change button is on
  312. - PA5 for LarsP/NKC
  313. - PC3 for Shadowolf's MMC2IEC 1.x
  314. - PC2 for Shadowolf's sd2iec 1.x
  315. ("Reserve" on the header)
  316. - PG4 for uIEC
  317.  
  318. Either of those buttons will trigger
  319. the use of AUTOSWAP.LST. If a swap
  320. list is already active, the first
  321. button will switch to the next image
  322. in the list, the second button will
  323. switch to the previous image in the
  324. list and pushing both buttons together
  325. will switch to the first image in the
  326. list.
  327.  
  328. The confirmation blink is red+green
  329. followed by green for "next", by red
  330. for "previous" and by red+green for
  331. "first".
  332.  
  333. Sleep Mode:
  334. ===========
  335. If you hold the disk change button
  336. down for two seconds, sd2iec will
  337. enter "sleep mode". In this mode it
  338. doesn't listen to the bus at all until
  339. you hold down the disk change button
  340. for two seconds again which resumes
  341. normal operation. Sleep mode allows
  342. you to keep sd2iec connected to the
  343. serial bus even when you load
  344. something from a different drive that
  345. uses a fast loader that doesn't work
  346. with more than one device on the bus.
  347.  
  348. While sleep mode is active, the red
  349. LED will be on and the green LED will
  350. be off.
  351.  
  352. Other important notes:
  353. ======================
  354. - File overwrite (@foo) is implemented
  355. by deleting the file first.
  356. - File sizes in the directory are in
  357. blocks (of 254 bytes), but
  358. the blocks free message actually
  359. reports free clusters. It is
  360. a compromise of compatibility,
  361. accuracy and code size.
  362. - If known, the low byte of the next
  363. line link pointer of the directory
  364. listing will be set to (file size
  365. MOD 254)+2, so you can calculate the
  366. true size of the file if required.
  367. The 2 is added so it can never be
  368. mistaken for an end marker (0) or
  369. for the default value (1, used by at
  370. least the 1541 and 1571 disk
  371. drives).
  372. - If your hardware supports more than
  373. one SD card, changing either one
  374. will reset the current partition to
  375. 1 and the current directory of
  376. all partitions to the root drive.
  377. Doing this just for the card that
  378. was changed would cause lots of
  379. problems if the number of partitions
  380. on the previous and the newly
  381. inserted cards are different.
  382.  
  383. Compilation notes:
  384. ==================
  385. sd2iec is set up to be compiled in
  386. multiple configurations, controlled by
  387. configuration files. By default the
  388. Makefile looks for a file named
  389. 'config', but you can override it by
  390. providing the name on the make command
  391. line with "make CONFIG=filename". If
  392. you are using *BSD you may have to
  393. edit the Makefile to use another awk
  394. implementation instead of gawk -
  395. unfortunately WinAVR compatibility
  396. requires using gawk in there.
  397.  
  398. An example configuration file named
  399. "config-example" is provided with the
  400. source code, as well as abridged files
  401. corresponding to the release binaries.
  402. If you want to compile sd2iec for a
  403. custom hardware you may have to edit
  404. config.h too to change the port
  405. definitions.
  406.  
  407. ==========
  408.